package com.mmy.service.oa.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.oa.LeaveInfoRepository;
import com.mmy.dao.oa.VSysLeaveInfoRepository;
import com.mmy.domain.oa.LeaveInfo;
import com.mmy.domain.oa.VSysLeaveInfo;
import com.mmy.service.oa.LeaveInfoService;

@Service
public class LeaveInfoServiceImpl implements LeaveInfoService {

	@Autowired
	LeaveInfoRepository leaveInfoRepository;

	@Autowired
	VSysLeaveInfoRepository vSysLeaveInfoRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VSysLeaveInfo> findAll() {
		// TODO Auto-generated method stub
		return vSysLeaveInfoRepository.findAll();
	}

	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */
	public Object getMaxLeaveID() {
		// TODO Auto-generated method stub
		return leaveInfoRepository.getMaxLeaveID();
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(LeaveInfo leaveInfo) {
		// TODO Auto-generated method stub
		leaveInfoRepository.save(leaveInfo);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */

	public void delLeaveInfo(List<Integer> lstLeaveID) {
		// TODO Auto-generated method stub
		leaveInfoRepository.delLeaveInfo(lstLeaveID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public LeaveInfo findByLeaveID(int iLeaveID) {
		// TODO Auto-generated method stub
		return leaveInfoRepository.findByLeaveID(iLeaveID);
	}



	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int leaveID) {
		// TODO Auto-generated method stub
		leaveInfoRepository.save(leaveID);
	}

	/**
	 * 通过name查找
	 * 
	 * @param
	 * @return
	 */
	public List<VSysLeaveInfo> findByTypeName(String strTypeName) {
		// TODO Auto-generated method stub
		return vSysLeaveInfoRepository.findByTypeName(strTypeName);
	}

}
